/* -----------------------------------------------------------------------
 * Chris Lewis
 * CS 362
 * Assignment 3: unittest2.c test of function numCards() in dominion.c
 *
 * unittest2: unittest2.c dominion.o rngs.o
 *      gcc -o unittest2 -g  unittest2.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define DEBUG 0
#define NOISY_TEST 1

int main () {

  int r;
  int count;  //num of cards in hand
  int k[10] = {adventurer, council_room, feast, gardens, mine,
               remodel, smithy, village, baron, great_hall};

  struct gameState G;
  
  r = initializeGame(2, k, 1, &G);

  puts("\n\n********* UNIT TEST 2 - numCards() ************\n");
  printf ("initializeGame(2, k, 1, &G) = %d\n", r);
  assert(r == 0);

  //check the number of cards in a hand after initial, and a round of play

  count  = numHandCards( &G);

  printf("Beginning # of cards in hand:%d\n", count); 
  assert(count == 5);
  int player = whoseTurn(&G); 
  //now draw some cards and check the hand count again
  int draw = drawCard(player, &G);
  count  = numHandCards( &G);
  printf("# of cards after drawCards():%d\n", count);
  assert(count == 6);
  printf("testNumCards: PASS\n"); 


  
  return 0;
}